/*
Copyright (C) 2018-2019 de4dot@gmail.com

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#if INSTR_INFO
using System;
using System.Collections.Generic;
using Iced.Intel;

namespace Iced.UnitTests.Intel.InstructionInfoTests {
	// GENERATOR-BEGIN: MiscConstants
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	static class MiscInstrInfoTestConstants {
		internal const string VMM_prefix = "vmm";
		internal const string XSP = "xsp";
		internal const string XBP = "xbp";
		internal const int InstrInfoElemsPerLine = 5;
		internal const int MemorySizeElemsPerLine = 6;
		internal const int RegisterElemsPerLine = 7;
	}
	// GENERATOR-END: MiscConstants

	static class InstructionInfoDicts {
		// GENERATOR-BEGIN: Dicts
		// ⚠️This was generated by GENERATOR!🦹‍♂️
		internal static readonly Dictionary<string, OpAccess> ToAccess = new Dictionary<string, OpAccess>(8, StringComparer.Ordinal) {
			{ "n", OpAccess.None },
			{ "r", OpAccess.Read },
			{ "cr", OpAccess.CondRead },
			{ "w", OpAccess.Write },
			{ "cw", OpAccess.CondWrite },
			{ "rw", OpAccess.ReadWrite },
			{ "rcw", OpAccess.ReadCondWrite },
			{ "nma", OpAccess.NoMemAccess },
		};
		internal static readonly Dictionary<string, MemorySizeFlags> MemorySizeFlagsTable = new Dictionary<string, MemorySizeFlags>(3, StringComparer.Ordinal) {
			{ "signed", MemorySizeFlags.Signed },
			{ "bcst", MemorySizeFlags.Broadcast },
			{ "packed", MemorySizeFlags.Packed },
		};
		internal static readonly Dictionary<string, RegisterFlags> RegisterFlagsTable = new Dictionary<string, RegisterFlags>(18, StringComparer.Ordinal) {
			{ "seg", RegisterFlags.SegmentRegister },
			{ "gpr", RegisterFlags.GPR },
			{ "gpr8", RegisterFlags.GPR8 },
			{ "gpr16", RegisterFlags.GPR16 },
			{ "gpr32", RegisterFlags.GPR32 },
			{ "gpr64", RegisterFlags.GPR64 },
			{ "xmm", RegisterFlags.XMM },
			{ "ymm", RegisterFlags.YMM },
			{ "zmm", RegisterFlags.ZMM },
			{ "vec", RegisterFlags.VectorRegister },
			{ "ip", RegisterFlags.IP },
			{ "k", RegisterFlags.K },
			{ "bnd", RegisterFlags.BND },
			{ "cr", RegisterFlags.CR },
			{ "dr", RegisterFlags.DR },
			{ "tr", RegisterFlags.TR },
			{ "st", RegisterFlags.ST },
			{ "mm", RegisterFlags.MM },
		};
		// GENERATOR-END: Dicts
	}

	// GENERATOR-BEGIN: KeysConstants
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	static class InstructionInfoKeys {
		internal const string IsProtectedMode = "pm";
		internal const string IsPrivileged = "priv";
		internal const string IsSaveRestoreInstruction = "saverestore";
		internal const string IsStackInstruction = "stack";
		internal const string IsSpecial = "special";
		internal const string RflagsRead = "fr";
		internal const string RflagsUndefined = "fu";
		internal const string RflagsWritten = "fw";
		internal const string RflagsCleared = "fc";
		internal const string RflagsSet = "fs";
		internal const string FlowControl = "flow";
		internal const string Op0Access = "op0";
		internal const string Op1Access = "op1";
		internal const string Op2Access = "op2";
		internal const string Op3Access = "op3";
		internal const string Op4Access = "op4";
		internal const string ReadRegister = "r";
		internal const string CondReadRegister = "cr";
		internal const string WriteRegister = "w";
		internal const string CondWriteRegister = "cw";
		internal const string ReadWriteRegister = "rw";
		internal const string ReadCondWriteRegister = "rcw";
		internal const string ReadMemory = "rm";
		internal const string CondReadMemory = "crm";
		internal const string ReadWriteMemory = "rwm";
		internal const string ReadCondWriteMemory = "rcwm";
		internal const string WriteMemory = "wm";
		internal const string CondWriteMemory = "cwm";
		internal const string DecoderOptions = "decopt";
	}
	// GENERATOR-END: KeysConstants

	// GENERATOR-BEGIN: DecoderOptionsConstants
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	static class InstructionInfoDecoderOptions {
		internal const string AmdBranches = "amdbr";
		internal const string ForceReservedNop = "forcereservednop";
		internal const string Umov = "umov";
		internal const string Xbts = "xbts";
		internal const string Cmpxchg486A = "cmpxchg486a";
		internal const string OldFpu = "oldfpu";
		internal const string Pcommit = "pcommit";
		internal const string Loadall286 = "loadall286";
		internal const string Loadall386 = "loadall386";
		internal const string Cl1invmb = "cl1invmb";
		internal const string MovTr = "movtr";
		internal const string Jmpe = "jmpe";
	}
	// GENERATOR-END: DecoderOptionsConstants

	// GENERATOR-BEGIN: RflagsBitsConstants
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	static class RflagsBitsConstants {
		internal const char AF = 'a';
		internal const char CF = 'c';
		internal const char OF = 'o';
		internal const char PF = 'p';
		internal const char SF = 's';
		internal const char ZF = 'z';
		internal const char IF = 'i';
		internal const char DF = 'd';
		internal const char AC = 'A';
	}
	// GENERATOR-END: RflagsBitsConstants

	// GENERATOR-BEGIN: MemorySizeFlags
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	[Flags]
	enum MemorySizeFlags : uint {
		None = 0x00000000,
		Signed = 0x00000001,
		Broadcast = 0x00000002,
		Packed = 0x00000004,
	}
	// GENERATOR-END: MemorySizeFlags

	// GENERATOR-BEGIN: RegisterFlags
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	[Flags]
	enum RegisterFlags : uint {
		None = 0x00000000,
		SegmentRegister = 0x00000001,
		GPR = 0x00000002,
		GPR8 = 0x00000004,
		GPR16 = 0x00000008,
		GPR32 = 0x00000010,
		GPR64 = 0x00000020,
		XMM = 0x00000040,
		YMM = 0x00000080,
		ZMM = 0x00000100,
		VectorRegister = 0x00000200,
		IP = 0x00000400,
		K = 0x00000800,
		BND = 0x00001000,
		CR = 0x00002000,
		DR = 0x00004000,
		TR = 0x00008000,
		ST = 0x00010000,
		MM = 0x00020000,
	}
	// GENERATOR-END: RegisterFlags
}
#endif
